package com.yuju.account.enums;

import com.yuju.account.enums.SettleAccountReturnCodeEnum;

/**
 * 类名：UnitAccountReturnCodeEnum  <br />
 *
 * 功能：
 *
 * @author : jiaokn <br />
 * @Date : 2017年12月7日 下午4:06:51  <br />
 * @version : 1.1 <br />
 */
public enum UnitAccountReturnCodeEnum {
	
	UNITACCOUNT_YSK_SUCCESS("yuju-UnitAccount-1001", "预收款成功"),
	UNITACCOUNT_YSK_FAILURE("yuju-UnitAccount-1002", "预收款失败"),
	UNITACCOUNT_SETTLE_SUCCESS("yuju-UnitAccount-1003", "结算成功"),
	UNITACCOUNT_SETTLE_FAILURE("yuju-UnitAccount-1004", "结算失败"),
	UNITACCOUNT_SAVE_SUCCESS("yuju-UnitAccount-1005", "单位账务新增成功"),
	UNITACCOUNT_SAVE_FAILURE("yuju-UnitAccount-1006", "单位账务新增失败"),
	UNITACCOUNT_CUSTOMER_FAILURE("yuju-UnitAccount-1007", "客户类型不匹配"),
	UNITACCOUNT_UPDATE_SUCCESS("yuju-UnitAccount-1008", "单位账务更新成功"),
	UNITACCOUNT_UPDATE_FAILURE("yuju-UnitAccount-1009", "单位账务更新失败"),
	UNITACCOUNT_LIST_SUCCESS("yuju-UnitAccount-10010", "单位账务列表查询成功"),
	UNITACCOUNT_LIST_FAILURE("yuju-UnitAccount-10011", "单位账务列表查询失败"),
	UNITACCOUNT_DETAILLIST_SUCCESS("yuju-UnitAccount-10012", "单位账务明细列表查询成功"),
	UNITACCOUNT_DETAILLIST_FAILURE("yuju-UnitAccount-10013", "单位账务明细列表查询失败"),
	UNITACCOUNT_QUERY_SUCCESS("yuju-UnitAccount-10014", "单位账务查找成功"),
	UNITACCOUNT_QUERY_FAILURE("yuju-UnitAccount-10015", "单位账务查找失败"),
	UNITACCOUNT_QUERY_NOTHING("yuju-UnitAccount-10016", "无数据"),
	UNITACCOUNT_GETYSK_SUCCESS("yuju-UnitAccount-10017", "单位预收款余额查找成功"),
	UNITACCOUNT_GETYSK_FAILURE("yuju-UnitAccount-10018", "单位预收款余额查找失败"),
	UNITACCOUNT_DETAIL_SUCCESS("yuju-UnitAccount-10019", "单位账务明细查询成功"),
	UNITACCOUNT_DETAIL_FAILURE("yuju-UnitAccount-10020", "单位账务明细查询失败"),
	UNITACCOUNT_SUBREPORT_SUCCESS("yuju-UnitAccount-10021", "单位账务子报表查询成功"),
	UNITACCOUNT_SUBREPORT_FAILURE("yuju-UnitAccount-10022", "单位账务子报表查询失败"),
	UNITACCOUNT_SUM_SUCCESS("yuju-UnitAccount-10021", "挂账合计查询成功"),
	UNITACCOUNT_SUM_FAILURE("yuju-UnitAccount-10022", "挂账合计查询失败");
	
	private String code;
	private String desc;
	
	UnitAccountReturnCodeEnum(String code, String desc) {
		this.code = code;
		this.desc = desc;
	}
	
	public static String getDescByCode(String code) {
		for (SettleAccountReturnCodeEnum enume : SettleAccountReturnCodeEnum.values()) {
			if (enume.getCode().equals(code)) {
				return enume.getDesc();
			}
		}
		
		return "未知枚举类型";
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getDesc() {
		return desc;
	}

	public void setDesc(String desc) {
		this.desc = desc;
	}
}
